#include "HouseTimer.h"

using namespace Ogre;

HouseTimer::HouseTimer(Ogre::Vector3 location, GridNode* g, Ogre::MeshPtr cubePtr, int iD) : Cube(location, "HouseTimer", g, cubePtr, iD)
{
	//MaterialPtr mat = MaterialManager::getSingleton().create("HouseTimerMat", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
	//mat->setDiffuse(0.5f, 0.5f, 0.5f, 1.0f);
	//mat->setAmbient(0.5f, 0.5f, 0.5f);

	//mCubeEntity->setMaterial( mat );

	//mCubeEntity->setMaterialName("HouseTimer");

	//default time
	houseTimer = 0.00;
	pause = false;
}

Ogre::Real HouseTimer::getTime()
{
	return houseTimer;
}

void HouseTimer::setTime(double time)
{
	this->houseTimer = time;
}

void HouseTimer::togglePause(bool pause)
{
	this->pause = !pause;	
}

bool HouseTimer::getPausedState()
{
	return pause;
}

void HouseTimer::update(Ogre::Real deltaTime)
{
	
	
	if(!pause)
		houseTimer = houseTimer - deltaTime;
	
}